package com.quasar.hpatient.presenter;

import com.quasar.hpatient.model.custommodel.DrugsAdjustmentData;
import com.quasar.hpatient.model.httpmodel.AnotherResult;
import com.quasar.hpatient.model.medicalmodel.PrescriptionDayData;
import com.quasar.hpatient.model.medicalmodel.QueryAllPrescription;
import com.quasar.hpatient.model.requestmodel.RequestModel;
import com.quasar.hpatient.onInterface.AnotherResultListener;
/**
 * author : 许建宏
 * Date: 2017/12/1 0001
 * View:
 */

public class EditmedicinePresenter {

    private RequestModel requestModel;
    private AnotherResultListener<AnotherResult<DrugsAdjustmentData>> listener;

    public EditmedicinePresenter(AnotherResultListener<AnotherResult<DrugsAdjustmentData>> listener) {
        this.requestModel = new RequestModel();
        this.listener = listener;
    }

    /**
     * 日常调药记录
     * @param page
     */
    public void QueryAllPrescriptionData(String  page){
        requestModel.QueryAllPrescription(page, new AnotherResultListener<AnotherResult<DrugsAdjustmentData>>() {
            @Override
            public void onSuccess(AnotherResult<DrugsAdjustmentData> data) {
                listener.onSuccess(data);
            }

            @Override
            public void onError(String msg) {
                listener.onError(msg);
            }

            @Override
            public void onRefreshUI() {
                listener.onRefreshUI();
            }
        });
    }
}
